<?php
include 'config/config.php';
include 'lib/member.php';
include 'lib/user.php';
include 'lib/kelas.php';
include 'lib/tipe.php';
include 'lib/produk.php';

$config=new config();
$config->connect();





if(isset($_GET['id'])){
$id=$_GET['id'];
$User_Dao = new User_Dao();
$user=$User_Dao->get_id($id);

$Member_Dao=new Member_Dao();
$member=$Member_Dao->get_id($id);

$Kelas_Dao=new Kelas_Dao();
$kelas=$Kelas_Dao->get_id($member->id_kelas);

$Produk_Dao=new Produk_Dao();
$produk=$Produk_Dao->get_idmember($user->id);
}


?>
<?php include("header.php") ?>
<?php include("menu_kiri.php") ?>

<div id="body">

<div class="menubox">
                
				  <br/> 
				  <h1>Data Profil</h1>
                  <br/>        
</div>    
<div class="topbox">
                  
<div class="leftbox2">		
		<?php 
				  if($member->foto_member!="") {
				  echo "<image src=\"member/images/hotel/$member->foto_member\" width=\"375\" height=\"250\">";
				  } else {
				  echo "<image src=\"images/hotel_1.png\">";
				  }
				  ?>
</div>
<div class="leftbox2">	
                  <table class="table">
				   <tr>
					<td >Nama Hotel</td>
					<td >:</td>
					<td ><?php echo $member->nama;?></td>
				    </tr>
				  <tr>
					<td>Email</td>
					<td>:</td>
					<td><?php echo $user->email;?></td>
				    </tr>
				  <tr>
					<td>Kelas Hotel</td>
					<td>:</td>
					<td><?php echo $kelas->kelas;?></td>
				    </tr>
				  <tr>
					<td>Fasilitas</td>
					<td>:</td>
					<td><?php echo $member->fasilitas_umum; ?></td>
				    </tr>
				  <tr>
					<td>Alamat</td>
					<td>:</td>
					<td><?php echo $member->alamat; ?></td>
				    </tr>
				  <tr>
					<td>No Telp</td>
					<td>:</td>
					<td><?php echo $member->no_telp; ?></td>
				    </tr>
				  
				  </table>
				  <br>
               
</div>
</div>

<div class="menubox">
                
				  <br/> 
				  <h1>Data Produk Hotel</h1>
                  <br/>        
</div>    
<div class="topbox">	
<div class="leftbox2">
				  
				  <div class="slider-wrapper theme-default">
            <div id="slider" class="nivoSlider">
			<?php foreach($produk as $Produk){
				if($Produk->foto_produk!=""){
                echo "<img src=\"member/images/produk/$Produk->foto_produk\" alt=\"\" title=\"".ucwords($Produk->nama_produk)."\"/>";
				}
            }?>
            </div>
            <div id="htmlcaption" class="nivo-html-caption">
            </div>
     </div>
</div>
<div class="leftbox2">	  
				 <table class="table">
				   <tr>
					<th>Nama Produk</th>
					<th>Tipe Bed</td>
					<th>Jumlah</th>
					<th>Fasilitas</th>
					<th>Harga</th>
					<th></th>
				   </tr>
				   <?php foreach($produk as $Produk){
				   $Tipe_Dao=new Tipe_Dao();
				   $tipe=$Tipe_Dao->get_id($Produk->id_tipe);
				   
				   ?>
				  <tr>
					<td><?php echo $Produk->nama_produk; ?></td>
					<td><?php echo $tipe->tipe;  ?></td>
					<td><?php echo $Produk->jumlah; ?></td>
					<td><?php echo $Produk->fasilitas; ?></td>
					<td><?php echo $Produk->harga;?></td>
					<td><?php echo "<a href=\"detil_produk.php?id=$Produk->id_produk\"><img src=\"images/icon_detail.gif\" /></a>";?></td>
				   </tr>
				  <?php }?>
				  </table>
				  <br>
                <br/>
</div>
</div>
				               
 
<div class="topbox"> 
<INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);">
                   	  
</div>                             
</div>
          
         <div class="clear"></div>
         <?php include("footer.php") ?>
		 
	<script type="text/javascript" src="js/jquery-1.8.2.js"></script>
    <script type="text/javascript" src="js/jquery.nivo.slider.js"></script>
		
		<script type="text/javascript">
    $(window).load(function() {
        $('#slider').nivoSlider();
    });
	$('div.nivoSlider').nivoSlider({
    //directionNav:false,
    controlNav:false,
    keyboardNav:false
	});
	
    </script>